var windowName = "news";
var Page,news;
apiready = function(){

    // onWindowShow(function () {
    // })
    onWindowHide(function () {
    })

    news = new List()
    Page = createVM("#Page",{
        //页面数据
        list:[],
    },{
        //页面方法
        "init":function () {
            this.list = getLocData("cacheNews")
            // showLoading()
            var _this = this;
            news.setUrl("/app/news/index")
                .setData({})
                .setCbFunc(function (data) {
                    _this.list = data
                    setLocData("cacheNews",data)
                    clearLoading()
                });
            // news.getList()
        },
        OnPullDownRefresh:function () {
            startPullDownRefresh()
            news.reload()
        },
        OnPullUpLoadMore:function () {
            startPullUpLoadMore()
            news.getList()
        },
    })
    Page.init()
}
function updateWinData() {
    log("news showed")
    news.reload()
}